//
//  TokDocManageUtilities.h
//  tok
//
//  Created by sijian on 12-9-19.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface TokDocManageUtilities : NSObject

//获取应用路径
+(NSString *) getAppWorkPath;

//获取数据库路径
+(NSString *) getDBDocPath;

//获取文件路径
+(NSString *) getFileDocPath;

//获得某个范围内的屏幕图像
+(UIImage *)getImageFromImage: (UIImage *) bigImage atFrame:(CGRect)myImageRect;

+(NSString *) getinsertPk;

+(void) createFilePath:(NSString *) subPath;

//获取当前路径
+(NSString *) getCurrentFilePath;

//创建新目录
+(BOOL)createNewDocWithDocPath:(NSString *)docPath;

//修改目录名
+(BOOL)modifyDocNameWithNewPathName:(NSString *)newPathName;

//删除目录
+(BOOL)deleteDocWithDocPath:(NSString *)docPath;

//列出目录内容
+(NSArray *)listContentsWithDocPath:(NSString *)docPath;

//获取目录或文件的属性
+(NSDictionary *)getDocumentAttributesWithPath:(NSString *)path;

//获取指定路径下的图片文件
+(NSMutableArray *) getImageWithDocPath:(NSString *)docPath;

//判断文件是否存在
+(BOOL)isExistWithFile:(NSString *)filePath;

//判断目录是否存在
+(BOOL)isExistWithDocPath:(NSString *)docPath;

//判断两个文件内容是否一致
+(BOOL)isMatchWithFile:(NSString *)filePath1 andWithFile:(NSString *)filePath2;

//获取文件名称
+(NSString *)getFileName:(NSString *)projCode andWithFile:(NSString *)classCode;

//判断文件是否可读
+(BOOL)isReadableWithFilePath:(NSString *)filePath;

//判断文件是否可写
+(BOOL)isWritableWithFilePath:(NSString *)filePath;

//判断文件是否可删除
+(BOOL)isDeletableWithFilePath:(NSString *)filePath;

//判断文件是否可执行
+(BOOL)isExecutableWithFilePath:(NSString *)filePath;

//移动文件
+(BOOL)moveFileWithOldPath:(NSString *)oldPath toNewPath:(NSString *)newPath;

//复制文件
+(BOOL)copyFileWithOldPath:(NSString *)oldPath toNewPath:(NSString *)newPath;

//删除文件
+(BOOL)deleteFileWithPath:(NSString *)filePath;

//创建符号链接
+(BOOL)createSymbolicLinkAtPath:(NSString *)filePath withDestinationPath:(NSString *)destinationPath;

//读取文件全部内容
+(NSData *)readFileContentWithFilePath:(NSString *)filePath;

//写入文件全部内容
+(BOOL)createFileAtPath:(NSString *)path contents:(NSData *)data attributes:(NSDictionary *)attr;

//从文件开头读取指定字节内容
+(NSData *)readFileContentAtPath:(NSString *)path toLength:(NSInteger) length;


//从指定字节位置开始读取，读取到文件结束
+(NSData *)readFileContentAtPath:(NSString *)path fromOffset:(NSInteger) offset;

//从指定字节开始读取，按给定的字节数进行读取
+(NSData *)readFileContentAtPath:(NSString *)path formOffset:(NSInteger)offset toLength:(NSInteger) length;

//从文件开头，进行覆盖写入
+(BOOL)writeDataFromBeginAtPath:(NSString *)filePath;

//从文件开头，进行插入写入
+(BOOL)insertDataFomeBeginAtPath:(NSString *)filePath;

//在文件结尾，进行追加写入
+(BOOL)writeDataFromEndAtPath:(NSString *)filePath;

//从指定字节处开始，进行覆盖写入
+(BOOL)writeDataAtPath:(NSString *)filePath fromOffset:(NSInteger)offset;

//从指定字节开始，进行插入写入
+(BOOL)insertDataAtPath:(NSString *)filePath fromOffset:(NSInteger)offset;

//删除文件夹及其所有内容
+(BOOL)deleteDictionaryAtPath:(NSString *)path;

//删除文件的所有内容
+(BOOL)deleteAllContentsAtPath:(NSString *)path;

//从文件开头，删除给定字节数的文件内容
+(BOOL)deleteFileContentAtPath:(NSString *)path withLength:(NSInteger)length;

//从文件指定位置开始，删除到文件尾
+(BOOL)deleteFileAtPath:(NSString *)path fromOffset:(NSInteger)offset;

//从文件指定位置开始，删除给定的字节数
+(BOOL)deleteFileContentAtPath:(NSString *)path fromOffset:(NSInteger)offset withLength:(NSInteger)length;

//标记文件目录不需要备份
+ (BOOL)addSkipBackupAttributeToFilePath:(NSString *)filePath;
//标记文件目录不需要备份
+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL;

@end
